<?php
/*
 * @block CategoryFilter
 * @item array
 */
?>
<li>
	<?php if ($item['count'] && !$block->isSelected($item)): ?>
	<a href="<?php echo $block->getItemUrl($item) ?>" class=" ajaxUpdate"><?php echo $item['name'] ?> <span class="count">(<?php echo $item['count'] ?>)</span></a>
	<?php else: ?>
	<span class="<?php if ($block->isSelected($item)) echo 'selected'; ?>"><?php echo $item['name'] ?>
		 <?php if ($block->isSelected($item)): ?><span class="count">(<?php echo $item['count'] ?>)</span><?php endif ?>
	</span>
	<?php endif ?>
	
	<?php $childs = $block->getItems($item['id']) ?>
	<?php if (count($childs)): ?>
	<ul>
		<?php foreach($childs as $child):?>
			<?php $this->renderPartial('/catalog/filter/category/item', array('item'=> $child, 'block'=>$block)) ?>
		<?php endforeach ?>
	</ul>
	<?php endif ?>
</li>